package com.yz.crm.department.service;

import java.util.List;
import java.util.Map;

import com.yz.crm.db.model.BaseDepartment;

public interface DepartmentService {

	BaseDepartment get (String id);
	
	/**
	 * 保存或更新
	 * 
	 * */
	boolean saveOrUpdate (BaseDepartment dept);
	
	/**
	 * 保存
	 * @param dept
	 * @return
	 * @throws Exception
	 */
	public Map<String,Object> save(BaseDepartment dept) throws Exception;
	
	/**
	 * 根据公司id列出所有顶层部门
	 * @param companyId
	 * @return
	 */
	public List<BaseDepartment> listTopDepartment(String companyId);
	
	/**
	 * 根据部门id,列出部门直属下级id
	 * @param departmentId
	 * @return
	 */
	public List<BaseDepartment> listDirectSub(String departmentId);
	
	/**
	 * 根据部门id获取部门所有下级部门
	 * @param departmentId
	 * @return
	 */
	public List<BaseDepartment> listAllSubordinateDept(String departmentId);
	
	/**
	 * 删除部门
	 * @param deptId
	 * @return
	 * @throws Exception
	 */
	public Map<String,Object> delete(String deptId) throws Exception;
}
